package com.yixiu;

import com.yixiu.modules.db.datasources.DynamicDataSourceConfig;
import com.yixiu.modules.shiro.ShiroConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.context.annotation.Import;


// 扫描Test中的modules下的所有包
@MapperScan(basePackages = {"com.yixiu"})

// 排除DataSourceAutoConfiguration中的dataSource(导入自定义动态数据源)；
// 排除ValidationAutoConfiguration，导入ShiroConfig中的securityManager
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,ValidationAutoConfiguration.class, PersistenceExceptionTranslationAutoConfiguration.class})
@Import({DynamicDataSourceConfig.class,ShiroConfig.class})

public class RenrenLearningApplication {

    public static void main(String[] args) {
        SpringApplication.run(RenrenLearningApplication.class, args);
    }
}
